In an OpenFlow network, there are two different connection modes between a switch and a controller, that is, an in-band connection mode and an out-of-band connection mode.
In the in-band connection mode, an in-band connection between a controller and a switch may be established in the following manner. That is, when an in-band connection is established between the controller and the switch, an existing protocol needs to be extended, the switch notifies the controller of a network topology using a specific message, and the controller can establish an in-band connection with the switch only after the controller acquires the network topology, and delivers, to an intermediate switch, information about a path used to forward a packet between the controller and the switch. However, in this manner, the existing OpenFlow protocol needs to be extended, and it is difficult for controllers and switches of different manufacturers to be compatible with each other.